iT邦幫忙

2021 iThome 鐵人賽

DAY 21
0
class Schedule():
    def content(self):
        flex_message = FlexSendMessage(
            alt_text='hello',
            contents={
            "type": "bubble",
            "header": {
                "type": "box",
                "layout": "vertical",
                "contents": [
                {
                    "type": "text",
                    "text": "Root_時刻表 選擇查看的組別",
                    "size": "lg",
                    "color": "#ffffff"
                }
                ],
                "backgroundColor": "#0066ff"
            },
            "body": {
                "type": "box",
                "layout": "vertical",
                "contents": [
                {
                    "type": "button",
                    "action": {
                    "type": "postback",
                    "label": "WEB",
                    "data": "Schedule:WEB",
                    "displayText": "組別:WEB"
                    },
                    "margin": "sm",
                    "color": "#0066ff",
                    "style": "primary"
                },
                {
                    "type": "button",
                    "action": {
                    "type": "postback",
                    "label": "IOT",
                    "data": "Schedule:IOT",
                    "displayText": "組別:IOT"
                    },
                    "color": "#0066ff",
                    "style": "primary",
                    "margin": "sm"
                },
                {
                    "type": "button",
                    "action": {
                    "type": "postback",
                    "label": "IOS",
                    "data": "Schedule:IOS",
                    "displayText": "組別:IOS"
                    },
                    "color": "#0066ff",
                    "margin": "sm",
                    "style": "primary"
                },
                {
                    "type": "button",
                    "action": {
                    "type": "postback",
                    "label": "Android",
                    "data": "Schedule:Android",
                    "displayText": "組別:Android"
                    },
                    "color": "#0066ff",
                    "style": "primary",
                    "margin": "sm"
                },
                {
                    "type": "button",
                    "action": {
                    "type": "postback",
                    "label": "碩班",
                    "data": "Schedule:碩班",
                    "displayText": "組別:碩班"
                    },
                    "color": "#0066ff",
                    "style": "primary",
                    "margin": "sm"
                }
                ]
            }
            }
        )
        return flex_message

再來我們這篇要完成的是"時刻表樣板",
目前進度已經完成87%了,
要在這幾天把所有的功能完成,
我們要先做的是樣板的標題名稱:Root_時刻表 選擇查看的組別,
為了區分使用者有沒有管理員權限,
才在名稱的最前面加上Root,再來就是下方的按鈕要有個組別名稱,
分別是"組別:WEB"、"組別:IOT"、"組別:IOS"、"組別:Android"、"組別:碩班",
以及按下按鈕以postback方式回傳,
然後下一篇我們將展示今天努力的成果~~~


今天的歌曲是 周杰倫-彩虹 Rainbow
https://www.youtube.com/watch?v=WxZvXPTBC0A&list=PLFl6Na2uUoOZBEhBtQ_jeGA4P1V20JvpW&index=20&ab_channel=%E5%91%A8%E6%9D%B0%E5%80%ABJayChou


上一篇
DAY20 本日尚未簽到、時刻表按鈕實現
下一篇
DAY22 時刻表選取組別功能實現
系列文
Line Bot 以python及Django建構30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言